//
//  DGBlockActionSheet.h
//  DGUIKit
//
//  Created by Jinxiao on 1/17/14.
//  Copyright (c) 2014 debugeek. All rights reserved.
//

typedef void (^DGBlockActionSheetBasicBlock) (void);
typedef void (^DGBlockActionSheetIndexBlock) (NSInteger index);

typedef enum _DGBlockActionSheetClickBlockType : NSInteger
{
    DGBlockActionSheetClickBlockTypeDidDismiss       = 0,
    DGBlockActionSheetClickBlockTypeDidClickButton   = 1,
} DGBlockActionSheetClickBlockType;

@interface DGBlockActionSheet : UIActionSheet

@property (readwrite, nonatomic, strong) DGBlockActionSheetBasicBlock willPresentBlock;
@property (readwrite, nonatomic, strong) DGBlockActionSheetBasicBlock didPresentBlock;
@property (readwrite, nonatomic, strong) DGBlockActionSheetBasicBlock didCancelBlock;
@property (readwrite, nonatomic, strong) DGBlockActionSheetIndexBlock didClickButtonBlock;
@property (readwrite, nonatomic, strong) DGBlockActionSheetIndexBlock willDismissBlock;
@property (readwrite, nonatomic, strong) DGBlockActionSheetIndexBlock didDismissBlock;
@property (readwrite, nonatomic, assign) DGBlockActionSheetClickBlockType clickBlockType;

+ (instancetype)actionSheetWithTitle:(NSString *)title;

- (NSInteger)addButtonWithTitle:(NSString *)title clickBlock:(DGBlockActionSheetBasicBlock)clickBlock;
- (NSInteger)addDestructiveButtonWithTitle:(NSString *)title clickBlock:(DGBlockActionSheetBasicBlock)clickBlock;
- (NSInteger)addCancelButtonWithTitle:(NSString *)title;
- (NSInteger)addCancelButtonWithTitle:(NSString *)title clickBlock:(DGBlockActionSheetBasicBlock)clickBlock;

@end